﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using PPAP.DAO;

namespace PPAP.BO
{
    public class T_FileBO
    {
        public T_FileBO() { }
        T_FileDAO dao = new T_FileDAO();
        /// <summary>
        /// 根据附件类型和id得到附件列表
        /// </summary>
        /// <param name="fileID"></param>
        /// <param name="types"></param>
        /// <returns></returns>
        public DataSet GetFileList(string fileID, int types)
        {
            return dao.GetFileList(fileID, types);
        }

        /// <summary>
        /// 根据部件id得到附件列表
        /// </summary>
        /// <param name="fileID"></param>
        /// <param name="types"></param>
        /// <returns></returns>
        public DataSet GetFileList(string fileID)
        {
            return dao.GetFileList(fileID);
        }

        /// <summary>
        /// 根据条件得到附件列表
        /// </summary>
        /// <param name="fileID"></param>
        /// <param name="types"></param>
        /// <returns></returns>
        public DataSet GetFileListForWhere(string sqlwhere,string sort)
        {
            return dao.GetFileListForWhere(sqlwhere,sort);
        }

        /// <summary>
        /// 根据id得到上传文件路径
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public DataSet Getpath(int id)
        {
            return dao.Getpath(id);
        }
        /// <summary>
        /// 根据附件id删除对应附件信息
        /// </summary>
        /// <param name="F_ID"></param>
        /// <returns></returns>
        public bool DeleteFile(string F_ID)
        {
            return dao.DeleteFile(F_ID);
        }
        /// <summary>
        /// 添加一条附件
        /// </summary>
        /// <param name="F_FileID"></param>
        /// <param name="F_Filename"></param>
        /// <param name="path"></param>
        /// <param name="types"></param>
        /// <returns></returns>
        public bool InsertFile(string F_FileID, string F_Filename, string path, int types, string url, string filesize, string remarks, string upby, string filetype, string pparid, string fileversion)
        {
            return dao.InsertFile(F_FileID, F_Filename, path, types, url,filesize,remarks,upby,filetype,pparid,fileversion);
        }

        /// <summary>
        /// 文件管理
        /// </summary>
        /// <param name="sqlwhere"></param>
        /// <returns></returns>
        public DataSet GetListForSearch(string sqlwhere)
        {
            return dao.GetListForSearch(sqlwhere);
        }
    }
}
